package com.itheima.health.consumer;

import com.itheima.health.common.RocketMqConst;
import com.itheima.health.vo.SmsLoginParam;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@RocketMQMessageListener(topic = RocketMqConst.TOPIC_SMS_SEND, consumerGroup = "sms-send-consumer")
public  class SmsSendConsumer implements RocketMQListener<SmsLoginParam> {

    @Override
    public void onMessage(SmsLoginParam smsLoginParam) {
        log.info("[短信发送消费者]received message: {}", smsLoginParam);
        log.info("[短信发送消费者]模拟发送，发送中……");
        log.info("[短信发送消费者]发送成功");

    }
}